﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<IntellectShop.Common.News>>" %>
<%@ Import Namespace="IntellectShop.Web2.Code" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%= Html.Resource("Index") %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

		<h1><%= Html.Resource("Index") %></h1>
		<p>
			<%= Html.ActionLink(Html.Resource("CreateNew"), "Create") %>
		</p>

		<% if (Model.Any())
		{ %>
		<table class="hovered">
			<tr>
				<th>
					<%= Html.LabelFor(model => model.First().Header) %>
				</th>
				<th>
					<%= Html.LabelFor(model => model.First().Body) %>
				</th>
				<th>
					<%= Html.LabelFor(model => model.First().SortingID) %>
				</th>
				<th>
					<%= Html.LabelFor(model => model.First().CreatedBy) %>
				</th>
				<th>
					<%= Html.LabelFor(model => model.First().Created) %>
				</th>
				<th>
					<%= Html.Resource("Action") %>
				</th>
			</tr>
			<% foreach (var item in Model)
		 { %>
			<tr>
				<td style="vertical-align: top;">
					<a name="id<%= item.NewsID %>"></a>
					<%= item.Header %>
				</td>
				<td style="vertical-align: top;">
					<%= item.Body %>
				</td>
				<td style="vertical-align: top;">
					<%= Html.Encode(item.SortingID) %>
				</td>
				<td style="vertical-align: top;">
					<%= Html.Encode(item.CreatedBy) %>
				</td>
				<td style="vertical-align: top;">
					<%= Html.Encode(String.Format("{0:g}", item.Created)) %>
				</td>
				<td style="vertical-align: top;">
					<%= Html.ActionLink(Html.Resource("Details"), "Details", new { newsID = item.NewsID })%>
					|
					<%= Html.ActionLink(Html.Resource("Edit"), "Edit", new { newsID = item.NewsID })%>
					|
					<%= Html.ActionLink(Html.Resource("Delete"), "Delete", new { newsID = item.NewsID })%>
				</td>
			</tr>
			<% } %>
		</table>
		<% } %>
	
</asp:Content>
